/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #ffffff;
    overflow: hidden;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    border: 2px solid #4a90e2;
    background: #000;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 开始界面 */
#startScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid #4a90e2;
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.5);
}

#startScreen h1 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #4a90e2;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

#startScreen p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #cccccc;
}

#startButton {
    background: linear-gradient(45deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

#startButton:hover {
    background: linear-gradient(45deg, #357abd, #4a90e2);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

#instructions {
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

#instructions h3 {
    color: #4a90e2;
    margin-bottom: 15px;
}

#instructions p {
    margin: 8px 0;
    color: #cccccc;
}

/* 游戏UI */
#gameUI {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

#healthBar {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #4a90e2;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

#healthFill {
    height: 100%;
    background: linear-gradient(90deg, #ff4757, #ff3742);
    width: 100%;
    transition: width 0.3s ease;
}

#levelInfo {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #4a90e2;
}

#timer {
    font-size: 1.2em;
    color: #4a90e2;
    font-weight: bold;
}

/* 升级界面 */
#upgradeScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #4a90e2;
    text-align: center;
    min-width: 400px;
}

#upgradeScreen h2 {
    color: #4a90e2;
    margin-bottom: 20px;
    font-size: 2em;
}

#upgradeOptions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.upgrade-option {
    background: rgba(74, 144, 226, 0.2);
    border: 2px solid #4a90e2;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-option:hover {
    background: rgba(74, 144, 226, 0.4);
    transform: scale(1.05);
}

.upgrade-option h3 {
    color: #4a90e2;
    margin-bottom: 10px;
}

.upgrade-option p {
    color: #cccccc;
    font-size: 0.9em;
}

/* 升级倒计时样式 */
.upgrade-timer {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 2px solid #4a90e2;
}

.timer-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 100%;
    transition: width 0.1s ease, background-color 0.3s ease;
}

.timer-text {
    color: #ffffff;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
}

#timerSeconds {
    color: #4a90e2;
    font-weight: bold;
}

/* 游戏结束界面 */
#gameOverScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid #ff4757;
    text-align: center;
}

#gameOverScreen h2 {
    color: #ff4757;
    margin-bottom: 20px;
    font-size: 2.5em;
}

#finalScore {
    font-size: 1.5em;
    color: #4a90e2;
    margin-bottom: 30px;
}

#restartButton {
    background: linear-gradient(45deg, #ff4757, #ff3742);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#restartButton:hover {
    background: linear-gradient(45deg, #ff3742, #ff4757);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    #gameCanvas {
        width: 100vw;
        height: 100vh;
        border: none;
    }
    
    #startScreen {
        padding: 20px;
        margin: 20px;
    }
    
    #startScreen h1 {
        font-size: 2em;
    }
    
    #upgradeScreen {
        min-width: 300px;
        margin: 20px;
    }
} 